package com.cdty.chess.controller;

import com.cdty.chess.model.Cuser;
import com.cdty.chess.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/api/v1/login")
public class LoginController {

    @Autowired
    LoginService service;


    @PostMapping("/login")
    public Map<String,Object> login(@RequestBody Cuser cuser) {
        return service.login(cuser);
    }

    @PostMapping("/home")
    public String home() {
        return "home";
    }
}
